package demo19;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        int maxStart = 0;
        int maxLength = 0;

        for (int left = 0,right = 0; right < s.length(); right++) {
            char c = s.charAt(right);

            if (c >= '0' && c <= '9'){
                int currentLength = right - left + 1;
                if(currentLength > maxLength) {
                    maxLength = currentLength;
                    maxStart = left;
                }
            }else {
                left = right + 1;
            }
        }

        System.out.println(s.substring(maxStart,maxStart + maxLength));

    }
}
